#include "ASM_optimizer.h"
#include <fstream>
#include <string>

void removeAdjacentDuplicateLines(const std::string& inputPath, const std::string& outputPath) {
    std::ifstream in(inputPath);
    std::ofstream out(outputPath);
    if (!in.is_open() || !out.is_open()) return;

    std::string prevLine, currLine;
    bool first = true;
    while (std::getline(in, currLine)) {
        if (first || currLine != prevLine) {
            out << currLine << std::endl;
        }
        prevLine = currLine;
        first = false;
    }
}